The invention relates to a method for programming a plurality of control units of a vehicle via a bus. The invention also relates to a device, a computer program, and a computer program product for programming a plurality of control units of a vehicle via a bus.
Modern vehicles have an increasingly large number of control units. If new firmware is written to one of these control units, it is possibly likewise necessary to write new firmware to further control units in order to match the control units to one another.
The object on which the invention is based is to provide a method and a corresponding device which contributes to making it possible to effectively program a plurality of control units of a vehicle.
The invention is distinguished by a method for programming a plurality of control units of a vehicle via a bus. The invention is also distinguished by a corresponding device. The control units of the vehicle are each changed to a persistent bus idle mode in which the control units each transmit messages on the bus only if they are requested from outside the respective control unit. While the control units are in the persistent bus idle mode, new firmware is written to each of the control units in a process of writing to the respective control unit. At least one subset of the control units is written to here in such a manner that the respective processes of writing to the subset of the control units overlap in terms of time.
In this context, persistent means that the respective control units are still in the persistent bus idle mode even after a restart. The control units are therefore in a bus idle mode until the latter is externally canceled.
The bus is, in particular, a Controller Area Network (CAN) bus, in particular according to the ISO standard 11898. The CAN bus is a serial bus system and is used, in particular, to network control units in vehicles.
In this context, the overlapping of the respective writing processes in terms of time means that new firmware is written to the respective control units virtually in a parallel manner. Since data are generally transmitted in succession in individual packets on the bus, these are virtually parallel writing processes which overlap in terms of time.
The procedure explained here therefore relates, in particular, to an expansion of the programming sequence according to the ISO standard 14229-1 (2013). The ISO standard 14229-1 specifies the Unified Diagnostic Services (UDS) communication protocol, where UDS is a communication protocol for making contact with and maintaining control units installed in a vehicle. The ISO standard 14229-1 likewise specifies a communication protocol for making contact with and maintaining control units installed in a vehicle via a CAN bus.
The corresponding device includes, in particular, a tester which is in the form of an MCD-3 D system according to the ISO 22900 series of standards, for example. In this case, MCD-3 represents a programming interface for applications for automotive server software. MCD-3 D describes domain-specific functionalities for diagnosing vehicle control units.
As a result of the fact that the writing processes overlap in terms of time, a plurality of control units can be programmed very effectively virtually at the same time since considerably less time is needed in this case than when serially writing to the control units in succession. The parallelism is restricted by a unit for controlling access to the vehicle or by a bus capacity of the bus. The access control unit includes the device, for example. The access control unit and the bus, to which the access control unit is connected, can process only a limited number of messages at the same time without errors. This results in a maximum capacity per bus. This maximum capacity is known to the device and is stored in the device, for example. The maximum capacity is used to avoid transmission errors which would otherwise possibly result in the respective writing process being aborted.
Since not all writing processes are possibly ended at the same time, it is important for the control units to be in the persistent bus idle mode. If the control units are not in the persistent bus idle mode, a control unit would possibly immediately begin again to transmit messages on the bus after a successful writing process and possibly a subsequent restart. These messages may interfere with the remaining writing processes which have not yet been ended or are still pending.
According to one advantageous configuration, the control units are each changed to the persistent bus idle mode by setting a persistent flag in the respective control unit.
A flag denotes, in particular, a data field which is respectively occupied by one of two values, a first value representing a flag which has been set and a second value representing a flag which has not been set. A flag can therefore be used to indicate particular states, in particular. A persistent flag is a flag which is still set even after the respective control unit has been restarted, that is to say until it is externally deleted, in particular.
Setting the persistent flag makes it possible to very effectively change the respective control unit to the persistent bus idle mode.
According to another advantageous configuration, a maximum implementation time is respectively predefined for the respective processes of writing to the control units. If the respective maximum implementation time is exceeded, the respective writing process is restarted.
Each process of writing to a control unit includes, in particular, the steps of deleting, writing and checking. Each of these steps may possibly last for several minutes. In this case, for example, each control unit transmits so-called ResponsePending messages to the device regularly, for example every 5 seconds. These messages include the information indicating that the respective control unit is not yet ready and still requires time for the response. As long as the respective control unit sends these messages, the device possibly does not abort the writing process. Therefore, the respective writing process is possibly not aborted if the respective control unit is in an endless loop.
The respective maximum implementation time prevents the device from endlessly waiting before the respective writing process is aborted. After waiting for the maximum implementation time, the respective writing process is aborted and either a process of writing to the next control unit is started if the control unit containing the error is actually in an endless loop or the process of writing to the control unit containing the error is repeated.
If the respective writing processes are carried out in an overlapping manner in terms of time, the use of the maximum implementation time is particularly advantageous since only limited resources are available in the vehicle and must be taken into account by the device. There is a maximum number of control units which can be handled at the same time on the same bus; if one or more connections are now occupied by a control unit in an endless loop, the performance decreases greatly. The respective maximum implementation time can therefore be used to contribute to the control units being written to very effectively.
According to another advantageous configuration, each software unit is subdivided into a plurality of software subunits. The software subunits of the respective software unit are transmitted to the respective control unit for one of the writing processes. If an error is detected in the respective writing process, only those software subunits which have not yet been transmitted or have been transmitted incorrectly are transmitted to the respective control unit for this writing process.
Since the entire software unit therefore possibly does not need to be transmitted again in the event of an error, but rather only individual software subunits are transmitted, the control units are programmed very effectively as a result.
According to another aspect, the invention is distinguished by a computer program for programming a plurality of control units of a vehicle via a bus, the computer program being designed to carry out the method for programming a plurality of control units of a vehicle via a bus or an advantageous configuration of the method on a data processing device.
According to another aspect, the invention is distinguished by a computer program product comprising executable program code, the program code carrying out the method for programming a plurality of control units of a vehicle via a bus or an advantageous configuration of the method during execution by a data processing device.
The computer program product comprises, in particular, a medium which can be read by the data processing device and stores the program code.
Other objects, advantages and novel features of the present invention will become apparent from the following detailed description of one or more preferred embodiments when considered in conjunction with the accompanying drawings.